<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../../Templates/SubFolderTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="head-title">
        <title>Add New Customer | Merlion's ERP System</title>
    </ui:define>
    
    
    <ui:define name="content">
        <h:form>
            <p:panel id="panel" header="Add New Customer"> 
                <p:ajaxStatus style="width:16px;height:16px;">   
                    <f:facet name="start">   
                        <p:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" /> 
                    </f:facet> 
 
                    <f:facet name="complete">   
                        <h:outputText value="" />   
                    </f:facet>   
                </p:ajaxStatus> 
 
                <p:messages /> 
 
                <h:panelGrid columns="3" cellpadding="10"> 
                    
                    <h:outputLabel for="customerName" style="font-weight: bold" value="Company Name: " /> 
                    <p:inputText value="#{addCustomerManagerBean.customerName}" required="true" label="Company Name" requiredMessage="Customer Name is required." id="customerName"> 
                    </p:inputText> 
                    <p:message for="customerName" /> 
                    
                    <h:outputLabel for="registrationNumber" style="font-weight: bold" value="Registration Number: " /> 
                    <p:inputText required="true" label="registrationNumber" requiredMessage="Registration Number is required." id="registrationNumber" value="#{addCustomerManagerBean.registrationNumber}"> 
                    </p:inputText> 
                    <p:message for="registrationNumber" /> 
 
                    <h:outputLabel for="address" style="font-weight: bold" value="Address: " /> 
                    <p:inputText required="true" label="address" requiredMessage="Address is required." id="address" value="#{addCustomerManagerBean.address}">                         
                    </p:inputText> 
                    <p:message for="address" /> 
                    
                    <h:outputLabel for="customerType" style="font-weight: bold" value="Customer Type: " /> 
                    <h:selectOneMenu id ="customerType" value="#{addCustomerManagerBean.customerType}">
                        <f:selectItem itemValue="WholeSale" itemLabel="Whole Sale" id="wholeSale" />
                        <f:selectItem itemValue="DirectSale" itemLabel="Direct Sale" id="directSale" />
                    </h:selectOneMenu>
                    
                    <p:message for="customerType" />
                    
                </h:panelGrid>
                
                <p:commandButton id="btn" value="Save New Customer" update="panel" actionListener="#{addCustomerManagerBean.saveNewCustomer}" ajax="true" />
                <p:commandButton value="Clear" type="reset"/>
            </p:panel> 
        </h:form>
    </ui:define>

</ui:composition>
